package main

import (
	"fmt"
	"time"
)

func main() {

	// timer: 倒计时，只能消费一次
	timer1 := time.NewTimer(time.Second * 2)
	t := <-timer1.C
	fmt.Printf("t:%v\n", t)
	fmt.Println("时间到...")

	<-time.After(time.Second* 2)
	fmt.Println("时间到...")

}